﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true"
    CodeFile="AddEvent.aspx.cs" Inherits="Admin_AddEvent" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script  type="text/javascript" language="javascript">
    function onCancel() {
        return false;
    }
</script>
    <div id="categorytree" class="tree">
        <asp:DropDownList runat="server" ID="ddlLanguageChoose" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguageChoose_SelectedIndexChanged">
            <asp:ListItem Text="Русский" Value="1"></asp:ListItem>
            <asp:ListItem Text="עברית" Value="2"></asp:ListItem>
        </asp:DropDownList>
        <asp:Button runat="server" ID="btnNew" Text="Новое событие" OnClick="btnNew_Click" />
        <asp:Calendar runat="server" ID="calendar1" SelectionMode="None" OnVisibleMonthChanged="Calendar1_SelectionChanged">
        </asp:Calendar>
        <br />
        <asp:DataList runat="server" ID="dlEvents" onitemdatabound="dlEvents_ItemDataBound">
            <ItemTemplate>
                <div style="background-color: Gray; color: White;">
                    <asp:Label runat="server" ID="lblDate" Text='<%# Convert.ToDateTime(Eval("startdate")).ToShortDateString() %>'></asp:Label></div>
                    <asp:Label runat="server" CssClass="txtEvent" ID="btnEditEvent" Text='<%# Eval("Title")%>'></asp:Label>
                    <asp:ImageButton runat="server" ID="imgUpdate" CommandArgument='<%# Eval("ID")%>'
                            AlternateText="Edit" ToolTip="Редактировать" ImageUrl="~/Admin/images/edit.png"
                            OnClick="btnEditEvent_Click" />
                    <asp:ImageButton runat="server" ID="imgDelete" CommandArgument='<%# Eval("ID")%>'
                AlternateText="Delete" ToolTip="Удалить" ImageUrl="~/Admin/images/delete.png" OnClick="imgDelete_Click" />    
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div id="content">
        <h2>
            Добавить событие</h2>
        <fieldset>
            <div>
                <asp:CheckBox runat="server" ID="chkCompetition" Text="Конкурс" />
            </div>
            <div>
                <asp:HiddenField runat="server" ID="hfEventID" />
                <asp:Label runat="server" AssociatedControlID="txtTitle">Заголовок события:</asp:Label>
                <asp:TextBox ID="txtTitle" runat="server" TextMode="SingleLine" Columns="80"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPageSummary" runat="server" ControlToValidate="txtTitle"
                    Text="&#9679;" ErrorMessage="● Поле необходимое для заполнения" Display="Dynamic" ValidationGroup="Send"></asp:RequiredFieldValidator>
            </div>
            <div>
                <asp:Label ID="Label1" runat="server" AssociatedControlID="txtStartDate">дата начала:</asp:Label>
                <ajax:CalendarExtender ID="CalendarExtender1" TargetControlID="txtStartDate" runat="server"
                    Enabled="true" Format="dd.MM.yyyy" PopupButtonID="btnGetStartDate" />
                <asp:Button ID="btnGetStartDate" runat="server" CssClass="CalendarBtn" />
                <asp:TextBox ID="txtStartDate" runat="server" TextMode="SingleLine" Columns="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtStartDate"
                    Text="&#9679;" ErrorMessage="" Display="Dynamic" ValidationGroup="Send"></asp:RequiredFieldValidator>
                <asp:Label ID="Label2" runat="server" AssociatedControlID="txtEndDate">Время окончания:</asp:Label>
                <ajax:CalendarExtender ID="CalendarExtender2" TargetControlID="txtEndDate" runat="server"
                    Enabled="true" Format="dd.MM.yyyy" PopupButtonID="btnEndDate" />
                <asp:Button ID="btnEndDate" runat="server" CssClass="CalendarBtn" />
                <asp:TextBox ID="txtEndDate" runat="server" TextMode="SingleLine" Columns="20"></asp:TextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEndDate"
                    Text="&#9679;" ErrorMessage="" Display="Dynamic" ValidationGroup="Send"></asp:RequiredFieldValidator>
            </div>
            <div>
                <asp:Label ID="Label7" runat="server" AssociatedControlID="txtStartTime">Время начала:</asp:Label>
                <asp:TextBox ID="txtStartTime" runat="server" TextMode="SingleLine" Columns="20"></asp:TextBox>
                <asp:Label ID="Label8" runat="server" AssociatedControlID="txtEndTime">Время окончания:</asp:Label>
                <asp:TextBox ID="txtEndTime" runat="server" TextMode="SingleLine" Columns="20"></asp:TextBox>
            </div>
            <div>
                <asp:Label ID="Label3" runat="server" AssociatedControlID="txtPlace">Место:</asp:Label>
                <asp:TextBox ID="txtPlace" runat="server" TextMode="SingleLine" Columns="80"></asp:TextBox>
            </div>
            <div>
                <asp:Label ID="Label4" runat="server" AssociatedControlID="txtContacts">Контакты:</asp:Label>
                <asp:TextBox ID="txtContacts" runat="server" TextMode="MultiLine" Columns="80" Rows="5"></asp:TextBox>
            </div>
            <div>
                <asp:Label ID="Label5" runat="server" AssociatedControlID="txtPrice">Цена:</asp:Label>
                <asp:TextBox ID="txtPrice" runat="server" TextMode="MultiLine" Columns="80" Rows="3"></asp:TextBox>
            </div>
            <div>
                <asp:Label runat="server" AssociatedControlID="fckPageContent">Содержание</asp:Label>
                <FCKeditorV2:FCKeditor runat="server" ID="fckPageContent" BasePath="~/fckeditor/"
                    Width="651px" EnableViewState="true" Height="228px" ToolbarSet="ArticleBasic">
                </FCKeditorV2:FCKeditor>
            </div>
            <div id="thumbnail" runat="server">
                <img runat="server" id="imgPreview" style="width: 588px; height: 100px;" />
                <br />
                <asp:Label ID="Label6" runat="server" AssociatedControlID="uplImage">Изменить картинку:</asp:Label>
                <ajax:AsyncFileUpload runat="server" ID="uplImage" Width="400px" CompleteBackColor="White"
                    UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" OnUploadedComplete="uplImage_UploadedComplete" />
                <asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/loading.gif" />
            </div>
            <asp:ValidationSummary ID="vsSummary" runat="server" CssClass="error" ValidationGroup="Send"
                DisplayMode="List" />
            <asp:Button ID="btnSave" runat="server" Text="Сохранить" OnClick="btnSave_Click"
                ValidationGroup="Send" />
        </fieldset>
    </div>
</asp:Content>
